import { Component } from '@angular/core';
import { IonicPage } from 'ionic-angular';
import { Router } from"@angular/router";
import {LocalstorageProvider} from '../../providers/localstorage/localstorage'
import { NativePageTransitions } from '@ionic-native/native-page-transitions';
import { Tools } from '../../tools/tools';
import { Network } from '@ionic-native/network';
/**
 * Generated class for the SettingsPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-settings',
  templateUrl: 'settings.html',
})
export class SettingsPage extends Tools{
  constructor(
    protected route:Router,
    private loc: LocalstorageProvider,
    protected nativePageTransitions: NativePageTransitions,
    protected network: Network
  ) {
    super(route, nativePageTransitions, network)
  }

  back () {
    this.goback()
  }

  LoginOut(){
    this.loc.remove("token");
    // this.loc.remove("subdomain");
    this.loc.remove("homeData");
    this.loc.remove("userinfo");
    if(!this.loc.remove("token")){
      this.openPage('login')
    }
  }

  goaccountNumber(){
    this.openPage('accountNumber')
  }
  aboutUs(){
    this.openPage('aboutUs')
  }
}
